import util from '../../common/js/util'
import NProgress from 'nprogress'
import axios from 'axios';
import address from "../../../models/dict/address"
import moment from 'moment'

import contractInfo from './contractInfo.vue';

import dContract from '../../../models/dict/dContract';
export default {
    data() {
        return {
            contractList: [],
            contractId: "",
            ShowSave: false,
            totalPage: 0,
            listLoading: false


        }
    },
    methods: {
        //性别显示转换
        saveContract() {

            this.ShowSave = false
            this.getContractList();
        },
        getContractList() {
            axios.post("/a", {
                class: "contract",
                para: "getContractList",
                j: {}

            }).then((res) => {

                this.contractList = res.data.list;

                this.totalPage = res.data.totalPage;
                this.listLoading = false;
                NProgress.done();


            });
        },

        handleCurrentChange() {

        },
        toSaveContract(row) {
            this.ShowSave = true

            if (row) {
                this.contractId = row._id
            }
            else {
                this.contractId = "";
            }
        },
        fmtDate() {

        }
        ,
        getStatusName(statusId) {

            return dContract.getStatusName(statusId)
        }

    },


    mounted() {
        this.getContractList();
    },
    components: {
        contractInfo
    }

}